package org.shilong.MContext.Party;

import org.shilong.MImpl.Party.AddNewPartyImpl;
import org.shilong.MImpl.Party.QueryAllPariesImpl;
import org.shilong.MImpl.Party.QueryMyPariesImpl;
import org.shilong.MImpl.Party.QueryPariesMeTakePartInImpl;
import org.shilong.MInterface.Party.PartyInterface;

public class PartyContext {

	private static PartyInterface PI = null;

	public final static int ADD_NEW_PARTY = 0;

	public final static int QUERY_MY_PAREIS = 1;

	public final static int QUERY_ALL_PARTIES = 2;

	public final static int QUERY_PARTIES_ME_TAKE_PART_IN = 3;

	public static PartyInterface getInstance(int type) {

		PI = null;

		switch (type) {
		case ADD_NEW_PARTY:

			PI = new AddNewPartyImpl();

			break;
		case QUERY_MY_PAREIS:

			PI = new QueryMyPariesImpl();
			break;

		case QUERY_ALL_PARTIES:

			PI = new QueryAllPariesImpl();
			break;
		case QUERY_PARTIES_ME_TAKE_PART_IN:

			PI = new QueryPariesMeTakePartInImpl();

			break;
		default:
			break;
		}

		return PI;
	}
}
